package com.example.lenovo.a32ui;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;

public class ImageViewTest extends AppCompatActivity implements View.OnClickListener{

    private Button mButton;
    private ImageView mImageView;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.imageview_layout);

        mButton = findViewById(R.id.btn_changeImage);
        mImageView = findViewById(R.id.imageView);

        mButton.setOnClickListener(this);

    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_changeImage: {
                mImageView.setImageResource(R.drawable.girl);
                break;
            }
            default:
        }
    }
}
